a14b030c577cd9330ecfa6a7eb5b4e1b5992f9e1,14-pr-web-security-practice/src/main/java/com/pr/config/SecurityConfig.java,SecurityConfig,configureGlobal,#AuthenticationManagerBuilder#,21

Before Change


    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) {
        try {
            auth.inMemoryAuthentication().withUser("john").password("doe").roles("USER");
            auth.inMemoryAuthentication().withUser("jane").password("doe").roles("USER,ADMIN");
            auth.inMemoryAuthentication().withUser("admin").password("admin").roles("ADMIN");
        } catch (Exception e) {

After Change


    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) {
        try {
            auth.inMemoryAuthentication().withUser("john").password("doe").roles("USER")
                    .and()
            .withUser("jane").password("doe").roles("USER,ADMIN")
            .and().withUser("admin").password("admin").roles("ADMIN");
        } catch (Exception e) {
            e.printStackTrace();
        }